package com.neuedu.spring.tx.dao;

import com.neuedu.spring.tx.entity.Account;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

/**
 * 项目：spring-java4
 * 创建时间：  2022-03-22   9:01
 * 作者 :jshand
 * 描述 :
 */
@Repository
public class AccountDao {

    @Autowired
    JdbcTemplate jdUtil;

    public int update(Account account){

        String sql  = " UPDATE  `account`  SET   `name` = ?,  `amount` = ?  WHERE `id` =  ? ";
        return jdUtil.update(sql,
                account.getName(),
                account.getAmount(),
                account.getId()
                );

    }

}
